﻿using System;
using System.ComponentModel;
using System.Data;
using ReflectionStudio.Core.Events;
using System.Windows;
namespace WPFExcelReport
{
    /// <summary>
    /// Interaction logic for EditEventWindow.xaml
    /// </summary>
    public partial class TSIMPLE
    {
        #region ==IsZOOM===========
        public static readonly DependencyProperty IsZOOMProperty = DependencyProperty.Register("IsZOOM",
            typeof(bool), typeof(TSIMPLE),
            new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsZOOMChanged));
        public bool IsZOOM
        {
            get
            {
                return (bool)GetValue(IsZOOMProperty);
            }
            set
            {
                SetValue(IsZOOMProperty, value);
            }
        }
        private static void OnIsZOOMChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as TSIMPLE;
            if (src != null)
            {
                src.IsZOOM = (bool)e.NewValue;
            }
        }
        #endregion
        public TSIMPLE()
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            MV = new ViewModelBase();
            MV.SetEnv = new DataSet();
            MV.SetProd = new DataSet();
            MV.SetData = new DataSet();
            this.DataContext = MV; 
            InitializeComponent(); 
        }
        MessageInfo msg;
        ViewBase ui;
        public override void OnWorkflowIDChange(MessageEventArgs e)
        {
            base.OnWorkflowIDChange(e);
            string wfid = e.Info.Details;
            msg = e.Info;
            switch (msg.ACTION)
            {
                case "CHGZM":
                    IsZOOM = !IsZOOM;
                    break;
            }
        }
    }
}
